import { myPost, myGet } from '@/util/request'
import { API_SERVER } from '../service'

const DEFAULT_API = `${API_SERVER}/v2`

/**
 * @desc 智能体分类列表
 */
export const getAgentTypeList = (data) => {
  return myPost(`${DEFAULT_API}/agent/type/list`, data )
}

/**
 * @desc 新增智能体分类
 */
 export const createAgentType = (data) => {
  return myPost(`${DEFAULT_API}/agent/type/add`, data )
}

/**
 * @desc 编辑智能体分类
 */
 export const updateAgentType = (data) => {
  return myPost(`${DEFAULT_API}/agent/type/edit`, data )
}

/**
 * @desc 删除智能体分类
 */
 export const deleteAgentType = (data) => {
  return myPost(`${DEFAULT_API}/agent/type/delete`, data )
}

/**
 * @desc 智能体分页列表
 */
 export const agentList = (data) => {
  return myPost(`${DEFAULT_API}/agent/index`, data )
}
/**
 * @desc 新增智能体
 */
 export const createAgent = (data) => {
  return myPost(`${DEFAULT_API}/agent/add`, data )
}

/**
 * @desc 编辑智能体
 */
 export const editAgent = (data) => {
  return myPost(`${DEFAULT_API}/agent/edit`, data )
}

/**
 * @desc 保存智能体
 */
 export const saveAgent = (data) => {
  return myPost(`${DEFAULT_API}/agent/save`, data )
}

/**
 * @desc 新增工作流
 */
 export const createAIFlow = (data) => {
  return myPost(`${DEFAULT_API}/xiaoe/aiflow/add`, data )
}
/**
 * @desc 删除智能体
 */
 export const deleteAgent = (data) => {
  return myPost(`${DEFAULT_API}/xiaoe/delete`, data )
}

/**
 * @desc 智能体配置详情
 */
 export const detailAgent = (data) => {
  return myPost(`${DEFAULT_API}/agent/detail`, data )
}

/**
 * @desc 查询模型列表
 */
 export const listModel = (data) => {
  return myPost(`${DEFAULT_API}/model/findall`, data )
}

/**
 * @desc 查询工具列表
 */
 export const listTools = (data) => {
  return myPost(`${DEFAULT_API}/tools/findall`, data )
}

/**
 * @desc 查询发布渠道列表
 */
 export const listPublish = (data) => {
  return myPost(`${DEFAULT_API}/publish/head/findall`, data )
}

/**
 * @desc 查询发布渠道详情
 */
 export const detailPublish = (data) => {
  return myGet(`${DEFAULT_API}/publish/head/detail`, data )
}

/**
 * @desc 查询对话日志列表
 */
 export const listLog = (data) => {
  return myPost(`${DEFAULT_API}/dialogue/log/index`, data )
}